home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / c / ExtrasLib.lha / ExtrasLib / Source / NNStrLen.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-30  |  759 b   |  44 lines

  1. #include <clib/extras/nnstring_protos.h>
  2. #include <extras/nnstring.h>
  3. #include <exec/types.h>
  4.  
  5. /****** extras.lib/nns_NNStrLen ******************************************
  6. *
  7. *   NAME
  8. *       nns_NNStrLen -- Return the length of an NNString.
  9. *
  10. *   SYNOPSIS
  11. *       length=nns_NNStrLen(NNStr)
  12. *
  13. *       LONG nns_NNStrLen(STRPTR);
  14. *
  15. *   FUNCTION
  16. *       Returns the length in bytes of an NNString, including the
  17. *       trailing NULLs. 
  18. *
  19. *   INPUTS
  20. *       NNStr - NNString pointer.
  21. *
  22. *   RESULT
  23. *       Size of NNStr include NULLs.
  24. *
  25. *   SEE ALSO
  26. *
  27. ******************************************************************************
  28. *
  29. */
  30.  
  31. LONG nns_NNStrLen(STRPTR NNStr)
  32. {
  33.   LONG l=0;
  34.   
  35.   while(*NNStr || *(NNStr+1))
  36.   {
  37.     NNStr++;
  38.     l++;
  39.   }
  40.   return(l+2);
  41. }
  42.  
  43.  
  44.